import 'package:flutter/widgets.dart';
import 'package:flutter_dk_form/flutter_dk_form.dart';
import 'package:flutter_dynamic_forms/flutter_dynamic_forms.dart';

import 'check_box.dart' as model;

class CheckBoxRenderer extends FormElementRenderer<model.DyCheckBox> {
  @override
  Widget render(
      model.DyCheckBox element,
      BuildContext context,
      FormElementEventDispatcherFunction dispatcher,
      FormElementRendererFunction renderer) {
    return Center(
      child: Padding(
        padding: const EdgeInsets.all(8.0),
        child: DkCheckBoxFormField(
          initialValue: element.value,
          title: Text(element.title),
          attribute: element.attribute,
        ),
      ),
    );
  }
}